bin=httpserver
cgi=cgi_test
cc=g++
LD_FLAGS=-std=c++11 -lpthread
src=main.cpp 
curr=$(shell pwd)/cgi_test.cpp

.PHONY:ALL
ALL:$(bin) $(cgi)
$(bin):$(src)
		$(cc) -o $@ $^ $(LD_FLAGS)

$(cgi):$(curr) 
		$(cc) -o $@ $^ $(LD_FLAGS)

.PHONY:clean
clean:
		rm $(bin) $(cgi)

.PHONY:output 
output:
		mkdir -p output 
		cp -rf $(bin) output/
		cp -rf wwwroot output/
		cp -rf $(cgi) output/wwwroot/
